home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ARASAN_S.ZIP / SHOWMOVE.CPP < prev    next >
C/C++ Source or Header  |  1994-02-19  |  876b  |  39 lines

  1. // Copyright 1994 by Jon Dart.  All Rights Reserved.
  2.  
  3. #include "showmove.h"
  4.  
  5. ShowMovesDialog::ShowMovesDialog(WPWin *pwin, Log &log)
  6. : the_log(log),
  7.   WPDialogModal("SHOWMOVES", pwin, NULL, NULL)
  8. {
  9.     createWin();
  10. }
  11.  
  12. void ShowMovesDialog::initDlg()
  13. {
  14.     const HWND hDlg = getHwnd();
  15.     HWND hList = GetDlgItem(hDlg,IDP_MOVE_LIST);
  16.     int i = 0;
  17.     while (i < the_log.num_moves())
  18.     {
  19.         char msg1[50];
  20.         char msg2[50];
  21.         char move1[10];
  22.         char move2[10];
  23.         strcpy(move1,the_log[i].image());
  24.         i++;
  25.         if (i<the_log.num_moves())
  26.         {
  27.            strcpy(move2,the_log[i].image());
  28.         }
  29.         else
  30.            *move2 = '\0';
  31.         wsprintf(msg1,"%d. %s",(i/2)+1,move1);
  32.             if (strlen(msg1) <= 8)
  33.            strcat(msg1,"\t");
  34.         wsprintf(msg2,"%s\t%s",msg1,move2);
  35.         SendMessage(hList,LB_ADDSTRING,0,(LONG)msg2);
  36.         i++;
  37.     }
  38. }
  39.